package com.xt.website.service.impl;
/*
 * @Author 爱尚实训赵国鑫
 * @ClassName  CategoryServiceImpl
 * @Date 2019/8/18/10:10
 * @Description TODO:(一句话描述这个类)
 */

import com.xt.website.dao.CategoryDao;
import com.xt.website.po.Category;
import com.xt.website.po.CategoryExt;
import com.xt.website.po.CategorySecond;
import com.xt.website.service.CategoryService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {

    @Resource
    private CategoryDao categoryDao;

    /**
     * 获取一二级类目集合
     * @return List<CategoryExt>
     */
    @Override
    public ArrayList<CategoryExt<CategorySecond>> getAllCategories() {
        return categoryDao.getAllCategories();
    }

    /**
     * 获取一级类目集合
     * @return
     */
    @Override
    public List<Category> getCategories() {
        return categoryDao.getCategories();
    }

    /**
     * 根据一级类目id获取二级类目集合
     * @param cid
     * @return
     */
    @Override
    public List<CategorySecond> findCategorySecondByCid(Integer cid) {
        return categoryDao.getCategorySecondsByCid(cid);
    }
}
